
using InfoTech.Utilities.Generic;

namespace InfoTech.LanTranh.MucVu.Bussiness
{
    public partial class SOHONNHAN
    {
        private GIAODAN _prt_giaodan_chong;
        private GIAODAN _prt_giaodan_vo;
        private GIAODAN _prt_giaodan_nhanchung1;
        private GIAODAN _prt_giaodan_nhanchung2;

        public GIAODAN PRT_GIAODAN_CHONG
        {
            get
            {
                if (RefreshType == InfoTech.Core.Data.RefreshType.Allway || (RefreshType == InfoTech.Core.Data.RefreshType.OnlyonNull && _prt_giaodan_chong == default(GIAODAN)))
                    InfoTech.Core.Data.Receiver.TypeObject<GIAODAN>.Select(this, "PRT_GIAODAN_CHONG", new[] { new Vector<string, string>("MAGIAODAN_CHONG", "MAGIAODAN") }, InfoTech.Core.Data.RelationType.OnetoOne);
                return _prt_giaodan_chong;
            }
            set
            {
                _prt_giaodan_chong = value;
            }
        }

        public GIAODAN PRT_GIAODAN_VO
        {
            get
            {
                if (RefreshType == InfoTech.Core.Data.RefreshType.Allway || (RefreshType == InfoTech.Core.Data.RefreshType.OnlyonNull && _prt_giaodan_vo == default(GIAODAN)))
                    InfoTech.Core.Data.Receiver.TypeObject<GIAODAN>.Select(this, "PRT_GIAODAN_VO", new[] { new Vector<string, string>("MAGIAODAN_VO", "MAGIAODAN"), }, InfoTech.Core.Data.RelationType.OnetoOne);
                return _prt_giaodan_vo;
            }
            set
            {
                _prt_giaodan_vo = value;
            }
        }

        public GIAODAN PRT_GIAODAN_NHANCHUNG1
        {
            get
            {
                if (RefreshType == InfoTech.Core.Data.RefreshType.Allway || (RefreshType == InfoTech.Core.Data.RefreshType.OnlyonNull && _prt_giaodan_nhanchung1 == default(GIAODAN)))
                    InfoTech.Core.Data.Receiver.TypeObject<GIAODAN>.Select(this, "PRT_GIAODAN_NHANCHUNG1", new[] { new Vector<string, string>("MANHANCHUNG1", "MAGIAODAN"), }, InfoTech.Core.Data.RelationType.OnetoOne);
                return _prt_giaodan_nhanchung1;
            }
            set
            {
                _prt_giaodan_nhanchung1 = value;
            }
        }

        public GIAODAN PRT_GIAODAN_NHANCHUNG2
        {
            get
            {
                if (RefreshType == InfoTech.Core.Data.RefreshType.Allway || (RefreshType == InfoTech.Core.Data.RefreshType.OnlyonNull && _prt_giaodan_nhanchung2 == default(GIAODAN)))
                    InfoTech.Core.Data.Receiver.TypeObject<GIAODAN>.Select(this, "PRT_GIAODAN_NHANCHUNG2", new[] { new Vector<string, string>("MANHANCHUNG2", "MAGIAODAN"), }, InfoTech.Core.Data.RelationType.OnetoOne);
                return _prt_giaodan_nhanchung2;
            }
            set
            {
                _prt_giaodan_nhanchung2 = value;
            }
        }

        private GIAODAN _prt_giaodan_cha;
        private GIAODAN _prt_giaodan_me;

        public GIAODAN PRT_GIAODAN_CHA
        {
            get
            {
                if (RefreshType == InfoTech.Core.Data.RefreshType.Allway || (RefreshType == InfoTech.Core.Data.RefreshType.OnlyonNull && _prt_giaodan_cha == default(GIAODAN)))
                    InfoTech.Core.Data.Receiver.TypeObject<GIAODAN>.Select(this, "PRT_GIAODAN_CHA", new[] { new Vector<string, string>("MAGIAODAN_CHA", "MAGIAODAN"), }, InfoTech.Core.Data.RelationType.OnetoOne);
                return _prt_giaodan_cha;
            }
            set
            {
                _prt_giaodan_cha = value;
            }
        }

        public GIAODAN PRT_GIAODAN_ME
        {
            get
            {
                if (RefreshType == InfoTech.Core.Data.RefreshType.Allway || (RefreshType == InfoTech.Core.Data.RefreshType.OnlyonNull && _prt_giaodan_me == default(GIAODAN)))
                    InfoTech.Core.Data.Receiver.TypeObject<GIAODAN>.Select(this, "PRT_GIAODAN_ME", new[] { new Vector<string, string>("MAGIAODAN_ME", "MAGIAODAN"), }, InfoTech.Core.Data.RelationType.OnetoOne);
                return _prt_giaodan_me;
            }
            set
            {
                _prt_giaodan_me = value;
            }
        }

        public string GetNgayCuoi()
        {
            string day = "", month = "", year = "";
            if (NGAY.HasValue)
                day = NGAY.Value.ToString("00") + "/";
            if (THANG.HasValue)
                month = THANG.Value.ToString("00") + "/";
            if (NAM.HasValue)
                year = NAM.Value.ToString("0000");
            return string.Format("{0}{1}{2}", day, month, year);
        }



    }
}
